
var express = require('express');
var router = express.Router();
var sql = require('../sql.js');
router.use('/', function(req, res) {
  /*res.send('1');*/ 
  var sex = req.body.picked; 
  var introduce=req.body.message;
  var address=req.body.location;
  var industry=req.body.selected;
  var personal=req.body.self;
  console.log(req.body)
  var userid = req.cookies.id
  sql(`update personal set sex="${sex}",introduce="${introduce}",address="${address}",industry="${industry}",personal="${personal}" where userid="${userid}"`,function(qerr,vals,fields){
    if(qerr){
        throw qerr
    }else{
        return res.json(vals)
    }
 })
})
module.exports = router;
